$(function () {
    $("#login_button").click(function () {
        $.modal.loading("登录中..");
        var userName = $("#userName").val();
        var password = $("#password").val();
        console.log(userName);
        console.log(password);
        var url = "/login";
        $.post(ctx + "login",{
            "loginName":userName,
            "password":password
        },function (data) {
            if(data.code == MSG.CODE.SUCCESS){
            	window.location.href="/index";
            } else {
                $.modal.close_Loading();
                parent.layer.msg(data.msg);
            }
        });
    })
})